
#ifndef  FILE_H
#define  FILE_H

#include "types.h"
#include "sleeplock.h"

/*  
struct file {
  enum {FD_NONE, FD_PIPE, FD_INODE, FD_DEVICE} type;
  int ref;
  char readable;
  char writable;
  struct inode * ip;
  uint off;
};
*/


struct inode {
  uint dev;
  uint inum; // inode index in device
  int ref;
  struct sleeplock lock;
  int valid;

  short type;    //copy of disk inode
  short major;
  short minor;
  short nlink;
  uint size;
  uint addrs[NDIRECT + 1];
};





#endif   /* FILE_H */
